class Coordinate
{
  //coordinates are not static, 
  Integrator x;
  Integrator y;
  
  Coordinate( float x, float y )
  {
    this.x = new Integrator( x );
    this.y = new Integrator( y );
  }
  
  Coordinate( int x , int y )
  {
    this((float) x, (float) y );
  }
  
  //--------------------------TARGETING AND MOVING-----------------------------------
  void target( float newX, float newY )
  {
    x.target( newX );
    y.target( newY );
  }
  
  void target( int newX, int newY )
  {
    this.target( (float) newX, (float) newY );
  }
  
  void targetX( float newX )
  {
    this.target( newX, y.target );
  }
  
  void targetY( float newY )
  {
    this.target( x.target, newY );
  }
  
  boolean isTargeting()
  {
    return x.isTargeting() || y.isTargeting();
  }
  
  void update()
  {
    if( x.isTargeting() )
      x.update();
    if( y.isTargeting() )
      y.update();
  }
  
  void moveRight( float diff )
  {
    targetX( x.value+diff );
  }
  
  void moveRight( int diff )
  {
    this.moveRight( (float)diff);
  }
  
  void moveLeft( float diff )
  {
    targetX( x.value-diff );
  }
  
  void moveLeft( int diff )
  {
    this.moveLeft( (float)diff);
  }
  
  void moveUp( float diff )
  {
    targetY( y.value-diff );
  }
  
  void moveUp( int diff )
  {
    this.moveUp( (float)diff);
  }
  
  void moveDown( float diff )
  {
    targetY( y.value+diff );
  }
  
  void moveDown( int diff )
  {
    this.moveDown( (float)diff);
  }
  //------------------------END TARGETING AND MOVING---------------------------------
  
  float getX()
  {
    return tx( x.value );
    //return x.value;
  }
  
  float getY()
  {
    return ty( y.value );
    //return y.value;
  } 
  
   float getActualX()
  {
    //return tx( x.value );
    return x.value;
  }
  
  float getActualY()
  {
    //return ty( y.value );
    return y.value;
  } 
}

